/**
 * Code is from pre-alpha
 * Needs to be updated for Alpha
 * */
using UnityEngine;
using System.Collections;

[System.Serializable]
public class DrawMainMenu : MonoBehaviour {	
	
	public GUISkin guiSkin;
	
	// Use this for initialization
	void Start () {
	}
	
	// Update is called once per frame
	void Update () {
		
	}
	
	void OnGUI() {
		GUI.skin = guiSkin;
		
		int resX = Screen.width;
		int resY = Screen.height;
		
		int buttonWidth = 128 + resX/2;
		int buttonHeight = 32;
		
		int btnNewGame_X = resX/2-buttonWidth/2;
		int btnNewGame_Y = resY/2-buttonHeight*8;
		
		int exitButton_X = btnNewGame_X;
		int exitButton_Y = btnNewGame_Y + buttonHeight*2;
		
		int testLevelButton_X = exitButton_X;
		int testLevelButton_Y = exitButton_Y + buttonHeight*2;
		
		bool newGame = GUI.Button(new Rect(btnNewGame_X, btnNewGame_Y, buttonWidth, buttonHeight), "New Game");
		bool exit = GUI.Button(new Rect(exitButton_X, exitButton_Y, buttonWidth, buttonHeight), "Exit");
		bool testLevel = GUI.Button(new Rect(testLevelButton_X, testLevelButton_Y, buttonWidth, buttonHeight), "Test Level");
		
		if (newGame) {
			Application.LoadLevel("Chapter1TrainStation");	
		} else if (testLevel) {
			Application.LoadLevel("MasterTest");	
		}
		
		if (exit) {
			Application.Quit();
		}
	}
}
